<template>
    <div class="login_cont">
        <!-- 返回首页 -->
        <div class="backIndex">
            <nuxt-link to="/">返回首页</nuxt-link>
        </div>
        <!-- 内容 -->
        <div class="loginContents">
            <!-- 左边内容 -->
            <login-left></login-left>
            <!-- 登录切换 -->
            <Login :backFlag="backFlag"></Login>
        </div>
    </div>
</template>

<script>
	import Login from './../../components/dialog/Login'
	import LoginLeft from './components/LoginLeft'
    let page = true
    export default {
    	name: 'login',
		components:{
	        LoginLeft,
	        Login,
            backFlag: true
	    },
        beforeRouteEnter (to, from, next) {
          // this.show是组件内定义的data用以判定v-if="show"是否成立
          // if(this.show){
          //  //如果show为true是显示状态，则next(false)返回from的组件(B组件)
          //    this.show=false
          //    console.log('111:',to,from)
          //     next(false);
          // }else{
            console.log('222:',to,from)
            if (!from.name) {
                page = false
            }
            //反之，则next(true)计入next组件(A组件) 
               next(true);
          // }
        },
        data: () => ({
        }),
        props: {
        },
        computed: {
        },
        created: function () {
            this.backFlag = page
            // console.log('this.backFlag::',this.backFlag)
        },
        methods: {
        }
    }
</script>
<style lang="scss">
// @import "../../assets/css/login.scss";
</style>

